/* 供应商组件 表格columns */
export const SUPPLY_COLUMNS_1 = [
  {
    title: '供应商编号',
    key: 'supplierCode',
    align: 'center'
  },
  {
    title: '供应商名称',
    key: 'supplierName',
    align: 'center'
  },
  {
    title: '主联系人',
    key: 'mainLinkman',
    align: 'center'
  },
  {
    title: '联系电话',
    key: 'mobile',
    align: 'center'
  },
  {
    title: '生产地址',
    key: 'productionAddress',
    align: 'center'
  },
  {
    title: '操作',
    slot: 'action',
    width: 150,
    align: 'center'
  }
]
/* 资质管理-新增 表格columns */
export const SUPPLY_COLUMNS_2 = [
  {
    title: '供应商编号',
    key: 'supplierNo',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '供应商名称',
    key: 'supplierName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '供应商状态',
    key: 'supplierStatusName',
  },
  {
    title: '主联系人',
    key: 'contractMan',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '联系电话',
    key: 'contractTel',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '生产地址',
    key: 'address',
    minWidth: 180
  },
  {
    title: '操作',
    slot: 'action',
    minWidth: 150,
    align: 'center'
  }
]
/* 售价定价原则-待启用 表格columns */
export const SUPPLY_COLUMNS_3 = [
  {
    title: '供应商编号',
    key: 'compareTargetUpdate',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '供应商名称',
    key: 'compareTargetNameUpdate',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '主联系人',
    key: 'compareManUpdate',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '联系电话',
    key: 'compareTelUpdate',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '生产地址',
    key: 'compareAddressUpdate',
    minWidth: 200
  },
  {
    title: '操作',
    slot: 'action',
    minWidth: 150,
    align: 'center'
  }
];

/**
 * 商品准入新增-供货信息
 */

// 是否选择list
const WHETHER_SELECT_LIST = [
  {
    value: '1',
    label: '是'
  },
  {
    value: '2',
    label: '否'
  }
]
// 供货信息表头
export const SUPPLY_SKUINFO_COLUMNS = [
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '规格',
    key: 'specDetailStr',
    render: (h, { row }) => (
      row.specDetailStr
        ? (<span>{ row.specDetailStr }</span>)
        : (<span > { row.supplyProductInfo.specDetailStr } </span>)
    )
  },
  {
    title: '厂家商品代码',
    key: 'factoryCode',
    type: 'input'
  },
  {
    title: '厂家商品名称',
    key: 'factoryName',
    type: 'input'
  },
  {
    title: '最小订货量',
    key: 'minOrderGoodsNum',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '是否保修',
    key: 'warrantyStatus',
    type: 'select',
    options: WHETHER_SELECT_LIST
  },
  {
    title: '保修天数',
    key: 'warrantyDay',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '是否可换货',
    key: 'exchangeGoodsStatus',
    type: 'select',
    options: WHETHER_SELECT_LIST
  },
  {
    title: '换货天数',
    key: 'exchangeGoodsDay',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '换货条件',
    key: 'exchangeGoodsCondition',
    type: 'input'
  },
  {
    title: '是否可退货',
    key: 'returnGoodsStatus',
    type: 'select',
    options: WHETHER_SELECT_LIST
  },
  {
    title: '退货天数',
    key: 'returnGoodsDay',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '退货条件',
    key: 'returnGoodsCondition',
    type: 'input'
  },
  {
    title: '最小退换货数量',
    key: 'minReOrExNum',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '商品销售最小残次品',
    key: 'minSaleImperfectionsNum',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '商品包装',
    key: 'productPacking',
    type: 'input'
  },
  {
    title: '其他服务承诺',
    key: 'otherPromise',
    type: 'input'
  }
];
// 参照城市关系表头
export const REFER_CITY_RELATION_COLUMNS = [
  {
    title: '销售城市',
    key: 'saleCityName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '供货城市',
    key: 'saleProvinceName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '区域',
    key: 'saleAreaName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '参照城市',
    key: 'templateCityName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '进价比例',
    key: 'buyPriceRatio',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '成本价比例',
    key: 'costPriceRatio',
    minWidth: 150,
    align: 'center'
  }
]
// 设置参照城市表格表头
export const SET_CITY_COLUMNS = [
  {
    type: 'selection',
    width: 60,
    align: 'center'
  },
  {
    title: '销售城市',
    key: 'saleCityName',
    minWidth: 110,
    align: 'center'
  },
  {
    title: '销售省',
    key: 'saleProvinceName',
    minWidth: 110,
    align: 'center'
  },
  {
    title: '是否供货',
    slot: 'isSupply',
    width: 100,
    render: (h, {
      row
    }) => {
      return <span > { row.isSupply == '1' ? '是' : '否' } </span>;
    }
  },
  {
    title: '业务区域',
    key: 'areaName',
    minWidth: 150,
    align: 'center'
  },
  {
    title: '参照城市',
    key: 'templateCityName',
    width: 150,
    type: 'Select'
  },
  {
    title: '进价比例',
    key: 'buyPriceRatio',
    width: 150,
    type: 'inputJin'
  },
  {
    title: '成本价比例',
    key: 'costPriceRatio',
    width: 150,
    type: 'input'
  }
]
// 供货价格相关信息表头 - 统一进价-单计量
export const UNITE_COLUMNS = [
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '规格',
    key: 'specDetailStr',
    render: (h, { row }) =>
      row.specDetailStr
        ? (<span> { row.specDetailStr } </span>)
        : (<span> {row.supplyProductInfo.specDetailStr} </span>)
  },
  {
    title: '主计量单位',
    key: 'mainUnitStr',
    /* render: (h, { row }) =>
      row.unitName ? (
        <span>{row.unitName}</span>
      ) : (
        <span>{row.supplyProductInfo.unitName}</span>
      ) */
  },
  {
    title: '进价类型',
    key: 'purchasePriceType',
    render: (h, { row }) => {
      if (row.purchasePriceType == 1) {
        return <span> 统一进价 </span>;
      } else if (row.purchasePriceType == 2) {
        return <span> 区域进价 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '主计量进价',
    key: 'mainPurchasePrice',
    type: 'inputNumChange',
    width: 160,
    precision: 3
  },
  {
    title: '厂家面价',
    key: 'factoryFacePrice',
    type: 'inputNumSpecial',
    width: 160,
    precision: 3
  },
  {
    title: '进价备注',
    key: 'purchasePriceNote',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '加价类型',
    key: 'addPriceType',
    render: (h, {
      row
    }) => {
      if (row.addPriceType == '1') {
        return <span> 固定金额 </span>;
      } else if (row.addPriceType == '2') {
        return <span> 比例 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '运费比例或金额',
    key: 'freightRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '包装比例或金额',
    key: 'packRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '加工费比例或金额',
    key: 'processChargesRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '返利折合比例或金额',
    key: 'rebateRatio',
    type: 'inputNumChange',
    width: 160,
    precision: 3
  },
  {
    title: '返利说明',
    key: 'rebateRatioDesc',
    type: 'inputNoLimit',
    width: 160,
    maxlength: 300
  },
  {
    title: '成本价',
    key: 'mainUnitCostPrice'
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  }
  /* { title: '操作', key: 'action', width: 90, fixed: 'right' } */
];
// 供货价格相关信息表头 - 区域进价 -单计量
export const AREA_COLUMNS = [
  {
    title: '参照城市',
    key: 'templateCityName'
  },
  {
    title: '业务区域',
    key: 'saleAreaName'
  },
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '规格',
    key: 'specDetailStr',
    render: (h, { row }) => (<span> { row.supplyProductInfo.specDetailStr || '' } </span>)
  },
  {
    title: '主计量单位',
    key: 'mainUnitStr',
  },
  {
    title: '进价类型',
    key: 'purchasePriceType',
    render: (h, {
      row
    }) => {
      if (row.purchasePriceType == 1) {
        return <span> 统一进价 </span>;
      } else if (row.purchasePriceType == 2) {
        return <span> 区域进价 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '主计量进价',
    key: 'mainPurchasePrice',
    type: 'inputNumChange',
    width: 160,
    precision: 3
  },
  {
    title: '厂家面价',
    key: 'factoryFacePrice',
    type: 'inputNumSpecial',
    width: 160,
    precision: 3
  },
  {
    title: '进价备注',
    key: 'purchasePriceNote',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '加价类型',
    key: 'addPriceType',
    render: (h, {
      row
    }) => {
      if (row.addPriceType == '1') {
        return <span> 固定金额 </span>;
      } else if (row.addPriceType == '2') {
        return <span > 比例 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '运费比例或金额',
    key: 'freightRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '包装比例或金额',
    key: 'packRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '加工费比例或金额',
    key: 'processChargesRatio',
    width: 160,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '返利折合比例或金额',
    key: 'rebateRatio',
    type: 'inputNumChange',
    width: 160,
    precision: 3
  },
  {
    title: '返利说明',
    key: 'rebateRatioDesc',
    type: 'inputNoLimit',
    width: 160,
    maxlength: 300
  },
  {
    title: '成本价',
    key: 'mainUnitCostPrice'
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  }
  /* { title: '操作', key: 'action', width: 90, fixed: 'right' } */
];
// 供货价格相关信息表头 - 统一进价-多计量
export const UNITE_COLUMNS_STEEL = [
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '规格',
    key: 'specDetailStr',
    render: (h, { row }) =>
      row.specDetailStr
        ? (<span> { row.specDetailStr } </span>)
        : (<span> { row.supplyProductInfo.specDetailStr } </span>)
  },
  {
    title: '供货计量单位',
    key: 'supplyGoodsUnit',
    render: (h, {
      row
    }) => (
      row.purchaseUnitStr
        ? (<span> { row.purchaseUnitStr } </span>)
        : (<span> { row.supplyProductInfo.supplyGoodsUnit } </span>)
    )
  },
  {
    title: '主计量单位',
    key: 'mainUnitStr',
  },
  {
    title: '理论转换率',
    key: 'theoryConvertRatio',
    type: 'inputNumSpecialChange',
    width: 160
  },
  {
    title: '实际转换率',
    key: 'actualConvertRatio',
    type: 'inputNumSpecialChange',
    width: 160
  },
  {
    title: '进价类型',
    key: 'purchasePriceType',
    render: (h, {
      row
    }) => {
      if (row.purchasePriceType == 1) {
        return <span> 统一进价 </span>;
      } else if (row.purchasePriceType == 2) {
        return <span> 区域进价 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '辅计量进价',
    key: 'purchasePrice',
    type: 'inputNumSpecialChange',
    width: 160,
    precision: 2
  },
  {
    title: '主计量进价',
    key: 'mainPurchasePrice',
    width: 100,
  },
  {
    title: '厂家面价',
    key: 'factoryFacePrice',
    type: 'inputNumSpecial',
    width: 160,
    precision: 3
  },
  {
    title: '进价备注',
    key: 'purchasePriceNote',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '加价类型',
    key: 'addPriceType',
    render: (h, {
      row
    }) => {
      if (row.addPriceType == '1') {
        return <span> 固定金额 </span>;
      } else if (row.addPriceType == '2') {
        return <span> 比例 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '运费比例或金额',
    key: 'freightRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '包装比例或金额',
    key: 'packRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '加工费比例或金额',
    key: 'processChargesRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '返利折合比例或金额',
    key: 'rebateRatio',
    type: 'inputNumSpecialChange',
    width: 160,
    precision: 3
  },
  {
    title: '返利说明',
    key: 'rebateRatioDesc',
    type: 'inputNoLimit',
    width: 160,
    maxlength: 300
  },
  {
    title: '理论转换率辅计量成本价',
    key: 'theoryConvertRatioCostPrice',
    width: 160
  },
  {
    title: '实际转换率辅计量成本价',
    key: 'actualConvertRatioCostPrice',
    width: 160
  },
  {
    title: '主计量成本价',
    key: 'mainUnitCostPrice',
    width: 100
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  }
  /* { title: '操作', key: 'action', width: 90, fixed: 'right' } */
];
// 供货价格相关信息表头 - 区域进价 -多计量
export const AREA_COLUMNS_STEEL = [
  {
    title: '参照城市',
    key: 'templateCityName'
  },
  {
    title: '业务区域',
    key: 'saleAreaName'
  },
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '规格',
    key: 'specDetailStr',
    render: (h, { row }) => (<span> { row.supplyProductInfo.specDetailStr || '' } </span>)
  },
  {
    title: '供货计量单位',
    key: 'supplyGoodsUnit',
    render: (h, { row }) => (
      row.purchaseUnitStr
        ? (<span> { row.purchaseUnitStr } </span>)
        : (<span> { row.supplyProductInfo.supplyGoodsUnit } </span>)
    )
  },
  {
    title: '主计量单位',
    key: 'mainUnitStr',
  },
  {
    title: '理论转换率',
    key: 'theoryConvertRatio',
    type: 'inputNumSpecialChange',
    width: 160
  },
  {
    title: '实际转换率',
    key: 'actualConvertRatio',
    type: 'inputNumSpecialChange',
    width: 160
  },
  {
    title: '进价类型',
    key: 'purchasePriceType',
    render: (h, {
      row
    }) => {
      if (row.purchasePriceType == 1) {
        return <span> 统一进价 </span>;
      } else if (row.purchasePriceType == 2) {
        return <span> 区域进价 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '辅计量进价',
    key: 'purchasePrice',
    type: 'inputNumSpecialChange',
    width: 160,
    precision: 2
  },
  {
    title: '主计量进价',
    key: 'mainPurchasePrice',
    width: 100,
  },
  {
    title: '厂家面价',
    key: 'factoryFacePrice',
    type: 'inputNumSpecial',
    width: 160,
    precision: 3
  },
  {
    title: '进价备注',
    key: 'purchasePriceNote',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '加价类型',
    key: 'addPriceType',
    render: (h, {
      row
    }) => {
      if (row.addPriceType == '1') {
        return <span> 固定金额 </span>;
      } else if (row.addPriceType == '2') {
        return <span> 比例 </span>;
      } else {
        return '';
      }
    }
  },
  {
    title: '运费比例或金额',
    key: 'freightRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '包装比例或金额',
    key: 'packRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '加工费比例或金额',
    key: 'processChargesRatio',
    width: 160,
    type: 'inputNumSpecialChange',
    precision: 3
  },
  {
    title: '返利折合比例或金额',
    key: 'rebateRatio',
    type: 'inputNumSpecialChange',
    width: 160,
    precision: 3
  },
  {
    title: '返利说明',
    key: 'rebateRatioDesc',
    type: 'inputNoLimit',
    width: 160,
    maxlength: 300
  },
  {
    title: '理论转换率辅计量成本价',
    key: 'theoryConvertRatioCostPrice',
    width: 160
  },
  {
    title: '实际转换率辅计量成本价',
    key: 'actualConvertRatioCostPrice',
    width: 160
  },
  {
    title: '主计量成本价',
    key: 'mainUnitCostPrice',
    width: 100
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  }
];
